package com.atguigu.k_toarray;

import java.util.stream.Stream;

public class Demo {
    public static void main(String[] args) {
        //创建2个流对象
        Stream<Integer> stream1 = Stream.of(1, 2, 3, 4, 5);
        Stream<String> stream2 = Stream.of("6", "7", "8", "9", "10");


        //合并车间
        Stream<Object> concat = Stream.concat(stream1, stream2);

        //转数组出工厂
        Object[] objs = concat.toArray();
        for (Object obj : objs) {
            System.out.println("obj = " + obj);
        }
    }
}
